package gongChang.before;

public class CoffeeStore {
    public Coffee orderCoffee(String type){
        Coffee coffee =null;
        if ("american".equals(type)){
            coffee=new AmericanoCoffee();
        }else if ("latte".equals(type)){
            coffee=new LatteCoffee();
        }else {
            throw new RuntimeException("没这种");
        }
        coffee.addSugar();
        coffee.addMilk();
        return coffee;
    }
}
